package com.generic;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.CompletableFuture;

import com.alibaba.fastjson.JSONObject;

public class Demo {
	
	public static void main(String[] args) {

		Food apple = new Apple();
		
		apple.setName("李召");
		apple.setAddress("新疆");
		apple.setExpirationTime(new Date());
		apple.setMadeIn("CHINA");
		
		Apple apple2 = new Apple();
		
		apple2.setName("魏闯");
		apple2.setAddress("新疆");
		apple2.setExpirationTime(new Date());
		apple2.setMadeIn("CHINA");
		
		
		List<Food> list = new LinkedList<>();
		list.add(apple);
		list.add(apple2);
		
		System.out.println(apple.toString());
		apple.test();
				
		Collections.sort(list,(o1, o2)-> 0
								
		);
		Collections.reverse(list);
		System.out.println(list.get(0));
		
	}

}
